package package06章_面向对象编程_基础._04oop.exer4;/**
 * ClassName: e_6_05MyArraysTest
 * Package: package06章_面向对象编程_基础.oop04.exer4
 * Description:
 *
 * @Author lys
 * @Create 2024/2/1 22:51
 * @Version 1.0
 */

/**
 * @author lys
 * @version 1.0
 * @description: TODO
 * @date 2024/2/1 22:51
 */
public class e_6_05MyArraysTest {
    public static void main(String[] args) {
        MyArrays arrs = new MyArrays();
        int[] arr = new int[]{34, 56, 223, 2, 56, 24, 56, 67, 778, 45};

        //求最大值
        System.out.println("最大值为：" + arrs.getMax(arr));
        //求平均值
        System.out.println("平均值为：" + arrs.getAvg(arr));

        //遍历
        arrs.print(arr);

        //查找l
        int index = arrs.linearSearch(arr, 24);
        if (index >= 0) {
            System.out.println("找到了，位置为：" + index);
        } else {
            System.out.println("未找到");
        }
        System.out.println("______________");
        //排序
        arrs.sort(arr);
        //遍历
        arrs.print(arr);
    }
}
